<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="models.BeanUser" %>
   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Exemple Formulari </title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<script>
$(document).ready(function(){
    $("#registerForm").validate({
    	submitHandler: function(form) {
    		$('#rightcolumn').load('formcontroller',$("#registerForm").serialize());
    }
    });
});
</script>
</head>
<body>

<%
	BeanUser user = null;
	if (request.getAttribute("user")!=null) {
		user = (BeanUser)request.getAttribute("user");
	} else {
		user = new BeanUser();
	}
%>

<form id="registerForm" action="" method="post" >
	<table align="center">
		<tr>
			<td class="registro">Alias:</td>
			<td><input type="text" maxlength="25" size="25" id="alias" name="alias" value="<%=user.getAlias() %>" class="required"/></td>
			<% if ( user.getError()[0] == 1) { %> 
				<td class="error"> El alias ya existe! Prueba con otro</td>  
			<% } %>
		</tr>
	</table>
</form>
</body>
</html>